<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
    <ui:define name="body">
        <h:messages globalOnly="true" styleClass="message"/>
        <rich:panel>
            <f:facet name="header">#{messages['user.list']}</f:facet>
            <div class="results">
                <h:outputText value="#{messages['user.list.nouser']}"
                              rendered="#{empty lotUserList.resultList}"/>
                <rich:dataTable id="lotUserList" var="lotUser"
                                value="#{lotUserList.resultList}"
                                rendered="#{not empty lotUserList.resultList}">
                    <rich:column>
                        <f:facet name="header">#{messages['user.name']}</f:facet>
                        <s:link id="lotUser"
                                value="#{lotUser.username}"
                                view="/lotUser.xhtml">
                            <f:param name="lotUserId"
                                     value="#{lotUser.id}"/>
                        </s:link>
                    </rich:column>
                    <rich:column sortBy="#{lotUser.lastName}">
                        <f:facet name="header">#{messages['user.lastname']}</f:facet>
                        #{lotUser.lastName}
                    </rich:column>
                    <rich:column>
                        <f:facet name="header">#{messages['user.firstname']}</f:facet>
                        #{lotUser.firstName}
                    </rich:column>
                    <rich:column>
                        <f:facet name="header">#{messages['user.email']}</f:facet>
                        <h:outputLink value="mailto:#{lotUser.emailAddress}" title="#{messages['user.email.writeto']}">
                            #{lotUser.emailAddress}
                        </h:outputLink>
                    </rich:column>
                    <rich:column>
                        <f:facet name="header">#{messages['user.role']}</f:facet>
                        #{lotUser.role.name}
                    </rich:column>
                </rich:dataTable>
            </div>
        </rich:panel>
        <div class="actionButtons">
            <s:button id="createUser"
                      value="#{messages['user.create']}"
                      view="/lotUserEdit.xhtml"/>
        </div>
    </ui:define>
</ui:composition>